package sanmubird.club.spring.启动.bean;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * User1
 *
 * @author sam
 * @date 2022/3/17 0017 17:42
 */
@Slf4j(topic = "c.User1")
@Component()
public class User1 implements BeanNameAware, BeanClassLoaderAware, BeanFactoryAware, ApplicationContextAware {

    private String name;

    public User1() {
        log.debug(" 构造方法 ");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Override
    public void setBeanName(String beanName) {
        log.debug(" setBeanName {}", beanName);
    }

    @Override
    public String toString() {
        return "User1{" +
                "name='" + name + "}";
    }

    @Override
    public void setBeanClassLoader(ClassLoader classLoader) {
        log.debug(" classLoader {} ", classLoader);
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        log.debug(" beanFactory {} ", beanFactory);
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        log.debug(" applicationContext {} ", applicationContext);
    }
}
